<?php
/*
Template Name: Tuan
*/

get_header(); ?>

<div class='videoduthi_side'>
                        <div class='side_content'>
                            <img src='<?php echo get_template_directory_uri()?>/img/header_videoduthi.png' class='title' alt=''/>
                            <div id='week_menu_content'>
                                <div id='week_menu'>
                                    <ul >
                                        <li id='week1'>
                                        	<?php if($pagename=='tuan-1'){?>
                                            <img src='<?php echo get_template_directory_uri()?>/img/button_week1_active.png' class='button_week_active' alt=''/>
                                            <?php }else{?>
                                            <a href='<?php echo home_url('/tuan-1')?>'><img src='<?php echo get_template_directory_uri()?>/img/button_week1.png' class='button_week' alt=''/></a>
                                            <?php }?>
                                        </li> 
                                        <li id='week2'>
                                            <?php if($pagename=='tuan-2'){?>
                                            <img src='<?php echo get_template_directory_uri()?>/img/button_week2_active.png' class='button_week_active' alt=''/>
                                            <?php }else{?>
                                            <a href='<?php echo home_url('/tuan-2')?>'><img src='<?php echo get_template_directory_uri()?>/img/button_week2.png' class='button_week' alt=''/></a>
                                            <?php }?>
                                        </li> 
                                        <li id='week3'>
                                            <?php if($pagename=='tuan-3'){?>
                                            <img src='<?php echo get_template_directory_uri()?>/img/button_week3_active.png' class='button_week_active' alt=''/>
                                            <?php }else{?>
                                            <a href='<?php echo home_url('/tuan-3')?>'><img src='<?php echo get_template_directory_uri()?>/img/button_week3.png' class='button_week' alt=''/></a>
                                            <?php }?>
                                        </li> 
                                        <li id='week4'>
                                            <?php if($pagename=='tuan-4'){?>
                                            <img src='<?php echo get_template_directory_uri()?>/img/button_week4_active.png' class='button_week_active' alt=''/>
                                            <?php }else{?>
                                            <a href='<?php echo home_url('/tuan-4')?>'><img src='<?php echo get_template_directory_uri()?>/img/button_week4.png' class='button_week' alt=''/></a>
                                            <?php }?>
                                        </li> 
                                        <li>
                                            <span id='search_button'>
                                                <input id='search_input' type='text' />
                                                <span style='margin-left:-20px'>
                                                    <a href='#'>
                                                        <img src='<?php echo get_template_directory_uri()?>/img/search.png' atl=''/>
                                                    </a>
                                                </span>
                                            </span> 
                                        </li>
                                    </ul>    
                                </div>

                            </div>
                            <div class='videoduthi_info'>
                                
<?php 
$args = array(
					 		//'showposts'=>6,
							'orderby' => 'id',
							'order' => 'DESC'
						);						
					 query_posts($args);
?>
                                <div id='video_content'>
                                <?php while ( have_posts() ) : the_post(); ?>	
		
                                    <a href='<?php the_permalink()?>'>
                                        <div class='video'>
                                        <?php echo the_post_thumbnail('medium',array('style'=>'width:169px;height:104px;','title'=>get_the_title(),'alt'=>get_the_title(),'class'=>'video_thumbnail') );?>
                                           <?php $vote=get_post_meta($post->ID,'vote',1);
                                           $count=0;	
                                           if(!empty($vote))$count=count($vote);
                                           	
                                           ?>     
                                            
                                            <div class='video_desc'>
                                                <span class='video_name'>Feeling Good</span>
                                                <span class='video_like_number'><?php  echo $count?></span>
                                                <span class='video_img'><img src='<?php echo get_template_directory_uri()?>/img/video_like.png' alt=''/>
                                                
                                                
                                                
                                                </span>
                                            </div>
                                        </div>
                                    </a>
                                    <?php endwhile; ?>
                                </div>
                            </div>
                            <div id='search_button'>
                                    <a href='#'>
                                        <img src='<?php echo get_template_directory_uri()?>/img/button_baiduthimoinhat.png' alt=''/>
                                        <img src='<?php echo get_template_directory_uri()?>/img/button_timkiemtheobigc.png' alt=''/>
                                    </a>
                            </div>
                        </div>

                    </div>


	<script>
	var gULR='<?php echo get_template_directory_uri()?>';
    (function($){
        $(window).load(function(){
            $("#video_content").mCustomScrollbar();
            // $("#video_content").mCustomScrollbar({
            //     horizontalScroll:true,
            //     theme:"light",
            //     scrollButtons:{
            //         enable:true
            //     }
            // });
        });
        

    })(jQuery);
    
</script>
<script>
$(function () {
        // $("#demo2 .required").watermark("Required", "watermark2");
        $('#search_input').watermark('Tìm theo tên, bài hát, địa điểm...');
        $("#d2-submit").click(
            function () {
                this.form.submit();
            }
        );
    });
</script>


<?php get_footer(); ?>